package com.example.demo.service;

import com.example.demo.entity.PlaylistCreate;
import com.example.demo.mapper.PlaylistCreateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service  // 必须有此注解，注册为 Spring 的 Bean
public class PlaylistCreateImpl implements PlaylistCreateService {

    @Autowired
    private PlaylistCreateMapper playlistCreateMapper;  // PlaylistCreateMapper 必须正确配置

    @Override
    public List<PlaylistCreate> getPlaylistsByUserId(int userId) {
        return playlistCreateMapper.selectPlaylistsByUserId(userId);
    }
}
